package com.estore.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;

import com.estore.entity.User_Profile;

public class User_ProfileMapper implements RowMapper<User_Profile> {
	@Override
	public User_Profile mapRow(ResultSet arg0, int arg1) throws SQLException {
		ResultSet rs = arg0;
		User_Profile profile = new User_Profile();

		profile.setUserID(rs.getInt("userID"));
		profile.setLastName(rs.getString("lastName"));
		profile.setFirstName(rs.getString("firstName"));
		profile.setEmail(rs.getString("email"));
		profile.setDateOfBirth(rs.getString("dateOfBirth"));
		profile.setSex(rs.getString("sex"));
		profile.setAddress(rs.getString("address"));
		profile.setPhoneNumber(rs.getString("phoneNumber"));
		profile.setRegDate(rs.getString("regDate"));
		profile.setLastLogin(rs.getString("lastLogin"));

		return profile;
	}

}
